//
//  Utial.m
//  ActSistant
//
//  Created by Hieu Nguyen Trung on 2/24/13.
//

#import "Util.h"

@implementation Util
+(CGRect) adjustCurrentFrame:(CGRect)frame withOriginX:(float)x originY:(float)y width:(float)width height:(float)height{
    CGRect rect = frame;
    rect.origin.x += x;
    rect.origin.y += y;
    rect.size.width += width;
    rect.size.height += height;
    return rect;
}

+ (UIImage *)imageWithColor:(UIColor *)color {
    CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    
    CGContextSetFillColorWithColor(context, [color CGColor]);
    CGContextFillRect(context, rect);
    
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return image;
}
@end
